#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from __future__ import print_function
import os
import sys
import bilibiliVideoUtil
reload(sys)
sys.setdefaultencoding('utf-8')

# 命令行第一个参数传入源目录, 生成后的目录名为: 源目录 + -transfer

print(sys.argv)

sourcePath = sys.argv[1]
targetPath = sourcePath + "-transfer"
try:
    os.makedirs(targetPath, 0755)
except OSError as e:
    pass

hVideoUtil = bilibiliVideoUtil.Video_utils(sourcePath, targetPath)
result = hVideoUtil.transfer()
print("transfer result: " + result.message)
